<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
	<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix='fmt' %> 
<table border="1" style="width:600px;margin:0 auto;">
<tr>
<td>id</td>
<td>名称</td>
<td>上传者</td>
<td>上传时间</td>
<td>删除</td>
</tr>
<c:forEach items="${tvs}" var="tv">
<tr>
	<td>${tv.id}</td>
	<td>${tv.name}</td>
	<td>${tv.user.name}</td>
	<td><fmt:formatDate value="${tv.createdate}" pattern="yyyy-MM-dd"/></td>
	<td><a href="javaScript:void(0)" onclick="del(${tv.id})">删除</a></td>
</tr>
</c:forEach>
</table>
<script>
function del(str){
	$.ajax({
		url:"delTv?id="+str,
		success:function(data){
			alert("删除成功!");
		}
	});
	
}

</script>